#include "SceneRendering.h"

#include "Runtime/Log/Logger.h"

namespace Alice
{
    IRendererModule* CachedRendererModule = NULL;
    IRendererModule* GetRendererModule()
    {
        if (!CachedRendererModule)
        {
            CachedRendererModule = new RendererModule;
        }

        return CachedRendererModule;
    }
    RendererModule::RendererModule()
    {
        
    }
    void RendererModule::BeginRenderingViewFamily()
    {
        SceneRenderer*sceneRenderer=new DeferredShadingRenderer;
        CGICommandListImmediate& RHICmdList = CGICommandListExecutor::GetImmediateCommandList();
        RDGBuilder rdgBuilder(RHICmdList);
        sceneRenderer->Render(rdgBuilder);
        rdgBuilder.Execute();
    }
    void DeferredShadingRenderer::Render(RDGBuilder& GraphBuilder)
    {
        PassParameter*passParameter=new PassParameter;
        GraphBuilder.AddDispatchPass(passParameter,ERDGPassFlags::Raster,[](RDGDispatchPassBuilder& DispatchPassBuilder)
        {
            Debug("Execute Dispatch Pass");
        });
    }
}
